{include file='header.tpl'}

<p>Get a server temporarily for free to host a match.</p>

<form action="{$form_action|escape:'html'}" method="post">        
    <table border="0" border="1" cellspacing="0" cellpadding="0" class="form">
        <tr>
            <th>Server:</th>
            <td>
                {if count($enable_autoselect) eq true}
                    <div><input type="radio" name="server" id="server_auto" value="autoselect" checked="checked" /> <label for="server_auto"><em>Auto-select an available server</em></label></div>
                {/if}
                {foreach from=$servers key=i item=server}
                    <div><input type="radio" name="server" id="server_{$i}" value="{$i}" /> <label for="server_{$i}"><img src="status.php?server={$i}&amp;__={0|rand:999999999}" alt="" title="Red: offline; orange: reserved; green: available" class="icon server-status" width="10px" height="10px" /> {$server.name} ({$server.host}:{$server.port})</label></div>
                {/foreach}
            </td>
        </tr>
        <tr class="form-split">
            <th><label for="password">Join password: </label></th>
            <td><input type="text" name="password" id="password" size="20" /></td>
        </tr>
        <tr class="last">
            <th><label for="login">Login password: </label></th>
            <td><input type="text" name="login" id="login" size="20" /> For changing the map</td>
        </tr>    
        {if count($user_settings) gt 0}
            {foreach name="fr_user_settings" from=$user_settings key=cvar item=opt}
            {if $opt.only_after_lease neq true}
            <tr{if $smarty.foreach.fr_user_settings.last eq true} class="last"{/if}{if $smarty.foreach.fr_user_settings.first eq true} class="form-split"{/if}>
                <th><label for="var_{$cvar}"><a href="http://digitalpaint.therisenrealm.com/reference/commands#{$cvar|escape:'url'}">{$cvar}</a>:</label></th>
                <td>
                    {if $opt.type eq 'int' or $opt.type eq 'float'}
                    <input type="text" id="var_{$cvar}" name="var_{$cvar}" size="5"{if count($default_settings.$cvar) gt 0} value="{$default_settings.$cvar|escape:'url'}"{/if} />
                    {elseif $opt.type eq 'string'}
                    <input type="text" id="var_{$cvar}" name="var_{$cvar}" size="30"{if count($default_settings.$cvar) gt 0} value="{$default_settings.$cvar|escape:'url'}"{/if} />
                    {elseif $opt.type eq 'bool'}
                    <select id="var_{$cvar}" name="var_{$cvar}">
                        <option value="true"{if count($default_settings.$cvar) gt 0 and $default_settings.$cvar eq 1} selected="selected"{/if}>true</option>
                        <option value="false"{if count($default_settings.$cvar) gt 0 and $default_settings.$cvar eq 0} selected="selected"{/if}>false</option>
                    </select>
                    {/if}
                </td>
            </tr>
            {/if}
            {/foreach}
        {/if}
        {if strlen($bot_check_string) gt 0}
            <tr class="form-split">
                <th><label for="botcheck">Bot check: </label></th>
                <td><input type="text" name="botcheck" id="botcheck" size="20" /><br />
                Enter the word <strong>{$bot_check_string|escape:'html'}</strong> into this box</td>
            </tr>
        {/if}
    </table>
    
    <p><input type="submit" value="Lease Server" /></p>
</form>

{include file='footer.tpl'}